﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
namespace DotNet.Data.Factory
{
    /// <summary>
    /// 数据库访问接口
    /// 本程序来自于"水煮鱼".ZR扩展参数支持及其事务支持
    /// </summary>
    public interface IDBHelp
    {
        #region"提供一对一的重载，能支持参数传值,"
         DataTable GetDataTable(string commandText, Hashtable ht);
         DataSet GetDataSet(string commandText, Hashtable ht);
         Object ExecuteScalar(string commandText, Hashtable ht);
        //事务级执行SQL语句
         int ExecuteNonQuery(string commandText, Hashtable ht);
         bool IsExists(string commandText, Hashtable ht);
         int GetRecordCount(string commandText, Hashtable ht);
         IList<string> GetList(string commandText, Hashtable ht);
        #endregion       

        #region"拼接SQL"
         DataTable GetDataTable(string commandText);
         DataSet GetDataSet(string commandText);
         string GetConnString();
         Object ExecuteScalar(string commandText);
         int ExecuteNonQuery(string commandText);
         bool IsExists(string commandText);
         int GetRecordCount(string commandText);
         IList<string> GetList(string commandText);
        #endregion

        #region"多种分页,支持50W以上的数据库分页写法,属于SQL拼接需要过滤"
         DataTable GetPageDataTable(int pageIndex, int pageSize, string fields, string tableName, string conditions, string orderField, bool isDesc);
         DataTable GetMPageDataTable(int pageIndex, int pageSize, string fields, string tableName, string conditions, string orderField, bool isDesc);
        #endregion
    }
}
